<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%-- <%@ taglib uri="http://libs.4coder.cn/static/jstl" prefix="s"%> --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>网站详情·思通投研·让数据驱动投资价值!</title>
    <link href="${pageContext.request.contextPath }/img/webLogoIcon.png"
          rel="shortcut icon">
    <link href="${pageContext.request.contextPath }/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/font-awesome.css"
          rel="stylesheet">

    <link href="${pageContext.request.contextPath }/css/animate.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/style.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/mypage.css"
          rel="stylesheet">
    <link
            href="${pageContext.request.contextPath }/css/plugins/sweetalert/sweetalert.css"
            rel="stylesheet">
    <!-- FooTable -->
    <link href="${pageContext.request.contextPath }/css/footable.core.css"
          rel="stylesheet">
    <link
            href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"
            rel="stylesheet"/>
    <link href="${pageContext.request.contextPath }/css/datepicker3.css"
          rel="stylesheet">


    <link rel="stylesheet" href="${pageContext.request.contextPath }/js/spiderflow/js/layui/css/layui.css"/>
    <style>
        .select2_demo_1 {
            float: left;
            width: 120px;
            display: inline;
            margin-left: 10px;
        }

        .form-control {
            display: inline;
        }

        .col-sm-3 {
            float: right;
            width: 560px;
        }

        .input-group {
            float: right;
            width: 240px;
            margin-left: 5px;
        }

        td {
            vertical-align: middle;
        }

        /* 策略sta */
        .tactics {
            width: 100%;
            height: 80px;
            overflow: auto;
            padding: 15px 0;
        }

        .btgroup {
            width: 60%;
            display: flex;
            justify-content: space-between;
        }

        /* 策略end */
    </style>

</head>

<body>

<div id="wrapper">

    <nav class="navbar-default navbar-static-side" role="navigation">
        <%
            request.setAttribute("LEFT", "website_admin");
        %> <%@include file="../datasource-left.jsp"%> </nav>

    <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom">
            <jsp:include page="../head-factory.jsp" flush="true"/>
        </div>
        <div class="row wrapper border-bottom white-bg page-heading">
            <div class="col-lg-9">
                <h2>网站详情</h2>
                <ol class="breadcrumb">
                    <li class="nav-main1"><a>主页</a>
                    </li>
                    <li class="nav-main2"><a id="navigation1" href="#">站点资源</a></li>
                    <li class="nav-main2"><a id="navigation1">网站列表</a>
                    </li>
                    <li class="active"><a>网站详情</a></li>
                </ol>
            </div>
        </div>

        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <div class="row" style="margin-top: 1%;">
                                <div class="col-lg-12">
                                    <%-- <button class="btn btn-white pull-right" onclick="window.location.href = '${pageContext.request.contextPath}/website/toupdatewebsite?websiteId=${website.id}'" type="button" style="margin-left: 2%;">编辑</button> --%>
                                </div>
                                <div class="col-lg-12">
                                    <div class="m-b-md">
                                        <!-- <a> class="btn btn-white btn-sm pull-right" -->
                                        <h2 style="margin-left: 7%; float: left;">
                                            <img src="${website.website_ico}" width="30px;"
                                                 style="vertical-align: bottom;">&nbsp;&nbsp;${website.website_name}
                                        </h2>
                                        <a style="float: left; margin: 1em 2em; color: inherit;"
                                           onclick="window.location.href = '${pageContext.request.contextPath}/website/toupdatewebsite?websiteId=${website.id}'"><i
                                                class="fa fa-edit"></i>&nbsp;编辑</a>
                                        <button class="btn btn-white pull-right"
                                                onclick="window.location.href = '${pageContext.request.contextPath}/admin/website_admin'"
                                                type="button" style="margin-left: 2%;">返回
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <div class="row" style="margin-top: 1%;">

                                <div class="col-lg-6">
                                    <dl class="dl-horizontal">
                                        <dt style="font-size: 16px;">网站类型:</dt>
                                        <dd style="font-size: 16px;">
                                            <c:choose>
                                                <c:when test="${website.new_website_type == 1}">微信</c:when>
                                                <c:when test="${website.new_website_type == 2}">微博</c:when>
                                                <c:when test="${website.new_website_type == 3}">政务</c:when>
                                                <c:when test="${website.new_website_type == 4}">论坛</c:when>
                                                <c:when test="${website.new_website_type == 5}">新闻</c:when>
                                                <c:when test="${website.new_website_type == 6}">报刊</c:when>
                                                <c:when test="${website.new_website_type == 7}">客户端</c:when>
                                                <c:when test="${website.new_website_type == 8}">网站</c:when>
                                                <c:when test="${website.new_website_type == 9}">外媒</c:when>
                                                <c:when test="${website.new_website_type == 10}">视频</c:when>
                                                <c:when test="${website.new_website_type == 11}">博客</c:when>
                                                <c:when test="${website.new_website_type == 12}">自媒体</c:when>
                                                <c:otherwise>其它</c:otherwise>
                                            </c:choose>
                                        </dd>
                                        <dt style="font-size: 16px;">主办单位名称:</dt>
                                        <dd style="font-size: 16px;">${website.sponsor}</dd>
                                        <dt style="font-size: 16px;">主办单位性质:</dt>
                                        <dd style="font-size: 16px;">${website.sponsor_nature}</dd>
                                        <dt style="font-size: 16px;">网站pr值:</dt>
                                        <dd style="font-size: 16px;">${website.website_pr}</dd>
                                        <dt style="font-size: 16px;">百度权重:</dt>
                                        <dd style="font-size: 16px;">${website.baidu_weight}</dd>
                                        <dt style="font-size: 16px;">涌亿思优先级:</dt>
                                        <dd style="font-size: 16px;">${website.site_rank}</dd>
                                    </dl>
                                </div>
                                <div class="col-lg-6" id="cluster_info">
                                    <dl class="dl-horizontal">
                                        <dt style="font-size: 16px;">网站地址:</dt>
                                        <dd style="font-size: 16px;">
                                            <a href="${website.website_url}" target="_blank"
                                               class="text-navy">${website.website_url}</a>
                                        </dd>
                                        <dt style="font-size: 16px;">创建时间:</dt>
                                        <c:set var="datestr" value="${website.create_date}"/>
                                        <c:set var="create_date"
                                               value="${fn:substring(datestr, 0, 19)}"/>
                                        <dd style="font-size: 16px;">${create_date}</dd>
                                        <dt style="font-size: 16px;">360权重:</dt>
                                        <dd style="font-size: 16px;">${website.thas_weight}</dd>
                                        <dt style="font-size: 16px;">alexa排名:</dt>
                                        <dd style="font-size: 16px;">${website.alexa_rank}</dd>
                                        <dt style="font-size: 16px;">备注信息:</dt>
                                        <dd style="font-size: 16px;">${website.website_remark}</dd>
                                        <dt style="font-size: 16px;">站点执行状态:</dt>
                                        <dd style="font-size: 16px;" id="starzt">
                                            <c:choose>
                                                <c:when test="${website.intelligent_match==0}">停止</c:when>
                                                <c:when test="${website.intelligent_match == 1}">开启</c:when>
                                                <c:when test="${website.intelligent_match == 2}">完成</c:when>
                                                <c:when test="${website.intelligent_match == 3}">执行中</c:when>
                                                <c:when test="${website.intelligent_match == 4}">失败</c:when>
                                                <c:when test="${website.intelligent_match == 31}">第一轮执行中</c:when>
                                                <c:when test="${website.intelligent_match == 32}">第二轮执行中</c:when>
                                                <c:otherwise>获取不到该站点状态信息</c:otherwise>
                                            </c:choose>
                                           </dd>
                                        <dt style="font-size: 16px;" >站点状态:</dt>
                                        <span id="web_stear" >
                                        <c:if test="${website.intelligent_match==0}">
                                            <button id="kaiqi"
                                                    type="button" style="line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;">开启
                                        </button>
                                        </c:if>
                                        <c:if test="${website.intelligent_match!=0}">
                                                <button id="chongqi"
                                                        type="button" style="line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;">重启
                                           </button>
                                             <button id="tingzhi"
                                                     type="button" style="line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;">停止
                                        </button>


                                        </c:if>
                                            </span>
                                    </dl>

                                    <c:if test="${website.intelligent_match==2}">
                                        <button class="btn btn-white pull-right" id="eliminate"
                                                type="button" style="margin-left: 2%;background: #dc1919;color: #2a0a0a;display:block;">清除临时站点信息
                                        </button>
                                    </c:if>

                                    <button class="btn btn-white pull-right" onclick="seesection(1)"
                                            type="button" style="margin-left: 2%;display:block;">查看栏目
                                    </button>

                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="seedhtml" class="ibox float-e-margins" style="display: block">
                        <div class="ibox-content">
                            <!--<button class="btn btn-outline btn-primary dim" type="button">添加种子</button>-->
                            <button class="btn btn-primary "
                                    onclick="window.open('${pageContext.request.contextPath}/spiderflow/saveSkip?websiteId=${website.id}') "
                                    type="button">
                                <i class="fa fa-plus"></i>&nbsp;添加种子
                            </button>
                            <table class="footable table table-stripped toggle-arrow-tiny"
                                   data-page-size="10" id="seed">
                                <thead>
                                <tr>

                                    <th style="width: 15%; text-align: center;">种子名称</th>
                                    <th style="width: 10%; text-align: center;">优先级</th>
                                    <th style="width: 15%; text-align: center;">创建时间</th>
                                    <th style="width: 10%; text-align: center;">今日采集量</th>
                                    <th style="width: 10%; text-align: center;">总计采集量</th>
                                    <th style="width: 10%; text-align: center;">cron</th>
                                    <th style="width: 10%; text-align: center;">采集类型</th>
                                    <th style="width: 10%; text-align: center;">状态修改</th>
                                    <th style="width: 10%; text-align: center;">查看详情</th>
                                </tr>
                                </thead>
                                <tbody id="spiderflows"></tbody>
                                <tfoot>
                                <tr>
                                    <td colspan="6" id="pagediv"></td>
                                </tr>
                                </tfoot>
                            </table>

                        </div>
                    </div>
                    <div id="columnhtml" class="ibox float-e-margins" style="display: none">
                        <div class="ibox-content">
                            <!--<button class="btn btn-outline btn-primary dim" type="button">添加种子</button>-->
                            <table class="footable table table-stripped toggle-arrow-tiny"
                                   data-page-size="10" >
                                <thead>

                                <tr>
                                    <th style="width: 3%; text-align: center;"> <input type="checkbox" id="all" />多选框</th>
                                    <th style="width: 15%; text-align: center;">栏目名称</th>
                                    <th style="width: 10%; text-align: center;">栏目地址</th>
                                    <th style="width: 15%; text-align: center;">创建时间</th>
                                    <th style="width: 10%; text-align: center;">sign（是否添加到xml）</th>
                                    <th style="width: 8%; text-align: center;">总计采集量</th>
                                    <th style="width: 10%; text-align: center;">查看数据</th>
                                </tr>
                                </thead>
                                <tbody id="spiderflows1"></tbody>
                                <tfoot>
                                <tr>
                                    <td colspan="6" id="pagediv1"></td>
                                </tr>
                                </tfoot>
                            </table>

                        </div>
                    </div>
                </div>
            </div>

        </div>
        <jsp:include page="../footer.jsp" flush="true"/>
    </div>


    <!-- Mainly scripts -->
    <script src="${pageContext.request.contextPath }/js/jquery-2.1.1.js"></script>
    <script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
    <script
            src="${pageContext.request.contextPath }/js/jquery.metisMenu.js"></script>
    <script
            src="${pageContext.request.contextPath }/js/jquery.slimscroll.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/mypage.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="${pageContext.request.contextPath }/js/inspinia.js"></script>
    <script src="${pageContext.request.contextPath }/js/pace.min.js"></script>

    <!-- Sweet alert -->
    <script
            src="${pageContext.request.contextPath }/js/plugins/sweetalert/sweetalert.min.js"></script>

    <!-- FooTable -->
    <script
            src="${pageContext.request.contextPath }/js/footable.all.min.js"></script>

    <script type="text/javascript"
            src="${pageContext.request.contextPath }/js/spiderflow/js/layui/layui.all.js"></script>

    <!-- Page-Level Scripts -->
    <script>
        $(document).ready(function () {
            JumpToPage(1);

        });

        $(document).on("click","#all",function () {
            debugger
            if (this.checked) {
                $('table input[type=checkbox]').attr('checked', true);
            } else {
                $('table input[type=checkbox]').attr('checked', false);
            }
        });

        function seesection(pageNum){
            $("#seedhtml").css("display","none");
            $("#columnhtml").css("display","block");
            $.ajax({
                url: "${pageContext.request.contextPath}/datasourcesite/see_section/${website.id}/"+pageNum+"/10",
                type: "get",
                success: function (res) {
                    if (res.status == 200) {
                        var pagedata = res.data
                        var spiderlist = pagedata.list

                        var spiderhtml = ''

                        if(spiderlist.length==0){
                            swal("列表为空", "查询列表为空", "error");
                        }else {
                        for (var i = 0; i < spiderlist.length; i++) {
                            let spiderflow = spiderlist[i];
                            let seed_status = spiderflow.sign == 1 ? "未插入xml表" : "已插入xml表";
                            spiderhtml += '<tr class="footable-odd" style="display: table-row;">' +
                                '<td style="text-align: center;"><span class="footable-toggle"></span> <input type="checkbox" /></td>' +
                                '<td style="text-align: center;"><span class="footable-toggle"></span>' + spiderflow.name + '</td>' +
                                '<td style="text-align: center;"><span class="footable-toggle"></span>' + spiderflow.web_link + '</td>' +
                                '<td style="text-align: center;"><span class="footable-toggle"></span>' + spiderflow.create_time + '</td>' +
                                '<td style="text-align: center;"><span class="footable-toggle"></span>' + seed_status + '</td>' +
                                '<td style="text-align: center;"><span class="footable-toggle"></span>' + "" + '</td>' +
                                '<td style="text-align: center;"><button type="button" onclick="pageopen(\'' + spiderflow.id + '\')" class="btn-white btn btn-xs">配置编辑</button></td>' +
                                '</tr>';
                        }
                        $("#spiderflows1").html(spiderhtml);
                            if (spiderlist.length > 0) {
                                $("#pagediv1").html('<div class="box" id="box2" style="float: right;"></div>')
                                paging2(pagedata.total, pagedata.pages, pagedata.pageNum);
                                $('.footable').footable();
                            }
                        }
                    }
                },
                error: function (e) {
                    swal("查询状态失败", "查询状态失败", "error");
                }
            })
        }
        $(document).on("click","#chongqi",function () {
            $.ajax({
                url: "${pageContext.request.contextPath}/datasourcesite/state/1/${website.id}",
                type: "get",
                success: function (res) {

                    if (res.status == 200) {

                        $("#web_stear").html("<button  id=\"chongqi\" type=\"button\" style=\"line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;\">重启</button><button   id=\"tingzhi\" type=\"button\" style=\"line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;\">停止 </button>\n" +
                            "")
                        $("#starzt").html("开启")
                        swal("修改成功", "状态已改变", "success");
                    }else {
                        swal("改变状态失败", "改变状态失败", "error");
                    }
                },
                error: function (e) {
                    swal("改变状态失败", "改变状态失败", "error");
                }
            })
        })

        $(document).on("click","#kaiqi",function () {
            $.ajax({
                url: "${pageContext.request.contextPath}/datasourcesite/state/1/${website.id}",
                type: "get",
                success: function (res) {
                    if (res.status == 200) {

                        $("#web_stear").html("<button  id=\"chongqi\" type=\"button\" style=\"line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;\">重启</button><button   id=\"tingzhi\" type=\"button\" style=\"line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;\">停止</button>\n" +
                            "")
                        $("#starzt").html("开启")
                        swal("修改成功", "状态已改变", "success");
                    }else {
                        swal("改变状态失败", "改变状态失败", "error");
                    }
                },
                error: function (e) {
                    swal("改变状态失败", "改变状态失败", "error");
                }
            })
        })
        $(document).on("click","#tingzhi",function () {
            $.ajax({
                url: "${pageContext.request.contextPath}/datasourcesite/state/0/${website.id}",
                type: "get",
                success: function (res) {
                    if (res.status == 200) {
                        $("#web_stear").html("<button   id=\"kaiqi\" type=\"button\" style=\"line-height: 1.42857143;background-color: #1b1e1b; padding: 1px 5px; background: #ffffff;border: 1px solid #e0dcdc; margin-left: 16px;color: #686b6d;border-radius: 3px;\">开启</button>")
                        $("#starzt").html("停止")
                        swal("修改成功", "状态已改变", "success");
                    }else {
                        swal("改变状态失败", "改变状态失败", "error");
                    }
                },
                error: function (e) {
                    swal("改变状态失败", "改变状态失败", "error");
                }
            })
        })

        $(document).on("click","#eliminate",function () {
            $.ajax({
                url: "${pageContext.request.contextPath}/datasourcesite/eliminate/${website.id}",
                type: "get",
                success: function (res) {
                    if (res.status == 200) {
                        $("#eliminate").css("display","none");
                        $("#seedhtml").css("display","block");
                        $("#columnhtml").css("display","none");
                        swal("清除成功", "临时数据已清除", "success");
                    }else {
                        swal("清除失败", "临时数据清除失败", "error");
                    }
                },
                error: function (e) {
                    swal("清除失败", "临时数据清除失败", "error");
                }
            })
        })

        function paging(totalData, totalPage, pagenum) {
            $('#box').paging({
                initPageNo: pagenum, // 初始页码
                totalPages: totalPage, //总页数
                totalCount: '合计' + totalData + '条数据', // 条目总数
                slideSpeed: 600, // 缓动速度 单位毫秒
                jump: true, //是否支持跳转
                callback: function (page) {
                    // 回调函数

                }
            });
        }
        function paging2(totalData, totalPage, pagenum) {

            $('#box2').paging({
                initPageNo: pagenum, // 初始页码
                totalPages: totalPage, //总页数
                totalCount: '合计' + totalData + '条数据', // 条目总数
                slideSpeed: 600, // 缓动速度 单位毫秒
                jump: true, //是否支持跳转
                callback: function (page) {

                }
            });
        }

        function JumpToPage(pagenum) {

            $.ajax({
                url: "${pageContext.request.contextPath}/spiderflow/spiderlist/${website.id}/" + pagenum+"/10",
                type: "get",
                success: function (res) {
                    if (res.status == 200) {
                        var pagedata = res.data
                        var spiderlist = pagedata.list
                        var spiderhtml = ''

                        for (var i = 0; i < spiderlist.length; i++) {
                            let spiderflow = spiderlist[i];
                            let seed_status = spiderflow.seed_status == 1 ? "关闭" : "开启";
                            spiderhtml += '<tr class="footable-odd" style="display: table-row;">' +
                                '<td style="text-align: center;"><span class="footable-toggle"></span>' + spiderflow.seed_name + '</td>' +
                                '<td style="text-align: center;" contenteditable="true" onkeyup="onlyNumber(this)" onblur="updateLevel(this,'+spiderflow.id+')">' + spiderflow.spider_level + '</td>' +
                                '<td style="text-align: center;">' + spiderflow.create_date + '</td>' +
                                '<td style="text-align: center;">0</td>' +
                                '<td style="text-align: center;">0</td>' +
                                '<td style="text-align: center;"><button id="cron' + spiderflow.id + '" type="button" class="btn-white btn btn-xs" onclick="updateCron(' + spiderflow.id + ',this)">' + spiderflow.cron + '</button></td>' +
                                '<td style="text-align: center;"><span id="typetitle' + spiderflow.id + '" style="line-height: 2;" class="label label-primary">' + spiderflow.typename + '</span></td>' +
                                '<td style="text-align: center;"><button id="typebutton' + spiderflow.id + '" type="button" onclick="updateSeedflag(' + spiderflow.id + ',' + spiderflow.seed_status + ')" class="btn-white btn btn-xs">' + seed_status + '</button></td>' +
                                '<td style="text-align: center;"><button type="button" onclick="pageopen(\'' + spiderflow.id + '\')" class="btn-white btn btn-xs">配置编辑</button></td>' +
                                '</tr>';
                        }
                        $("#spiderflows").html(spiderhtml);
                        if (spiderlist.length > 0) {
                            $("#pagediv").html('<div class="box" id="box" style="float: right;"></div>')
                            paging(pagedata.total, pagedata.pages, pagenum);
                            $('.footable').footable();
                        }
                    }
                },
                error: function (e) {
                    swal("获取爬虫列表页失败", "查询出错", "error");
                }
            })

        }

        function pageopen(id) {
//         	console.log(id)
            window.open('${pageContext.request.contextPath}/spiderflow/detail/' + id, "_blank");
        }

        function updateSeedflag(seedId, seedStatus) {

            if (confirm('确定要修改吗') == true) {
                let seedNewStatus = seedStatus == 1 ? 0 : 1;

                $.ajax({
                    url: "${pageContext.request.contextPath}/spiderflow/updateSpiderStatus",
                    data: {
                        id: seedId,
                        seed_status: seedNewStatus
                    },
                    type: "get",
                    success: function (res) {
                        if (res.status == 200) {
                            if (seedStatus == 1) {
                                $("#typetitle" + seedId).attr("class", "label label-danger");
                                $("#typetitle" + seedId).html("已关闭");
                                $("#typebutton" + seedId).attr("onclick", "updateSeedflag(" + seedId + ",0)");
                                $("#typebutton" + seedId).html("开启");
                            }
                            if (seedStatus == 0) {
                                $("#typetitle" + seedId).attr("class", "label label-primary");
                                $("#typetitle" + seedId).html("运行中");
                                $("#typebutton" + seedId).attr("onclick", "updateSeedflag(" + seedId + ",1)");
                                $("#typebutton" + seedId).html("关闭");
                            }
                            swal("修改成功", "状态已改变", "success");

                        }
                    },
                    error: function (e) {
                        swal("修改失败", "状态未改变", "error");
                    }
                })
            }

        }

        function updateCron(seedId, cron) {

            parent.layer.open({
                type: 2,
                area: ['50%', '50%'],
                fixed: false, //不固定
                maxmin: true,
                content: '${pageContext.request.contextPath}/spiderFlowSkip/cron?id=' + seedId + '&cron=' + $(cron).html()
            });
        }

        function onlyNumber(obj) {

            //先把非数字的都替换掉，除了数字和
            $(obj).html($(obj).html().replace(/[^\d]/g, ''));
            //前两位不能是0加数字
            $(obj).html($(obj).html().replace(/^0\d[0-9]*/g, ''));
            //必须保证第一个为数字而不是.
            $(obj).html($(obj).html().replace(/^\./g, ''));
        }

        function updateLevel(obj,id) {
            let level = $(obj).html();
            $.ajax({
                url: "${pageContext.request.contextPath}/spiderflow/save",
                data: {
                    id: id,
                    spider_level: level
                },
                type: "get",
                success: function (res) {
                    if (res.status == 200) {
                        $(obj).html(level);
                    }
                },
                error: function (e) {
                    swal("修改失败", "优先级未改变", "error");
                }
            })
        }
    </script>

    <script
            src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
</body>

</html>
